<?php
/*
	[gunianwang system]
	NAME:agency_model
	AUTHOR:hl
	DATE:2012-07-02
*/
if (!defined('IN_ELS'))
{
    die('Hacking attempt');
}

class agencybase extends base {
	function agencybase() {
		$this->base();
	}
	//添加入库操作
	function insertagency($data){
		$retValue = $this->dbInsert("gnw_agency",$data);
		return $retValue;
	}
	//删除操作
	function deleteagency($where){
		$retValue = $this->dbDelete("gnw_agency",$where);
	}
	//修改操作
	function updateagency($data,$where){
		$retValue = $this->dbUpdate("gnw_agency",$data,$where);
		return $retValue;
	}
	//查询数量操作
	function getagencyCount($where){
		$sqlText = "select count(*) from gnw_agency ";
		$sqlText .= $where;
		$data=$this->db->result_first($sqlText);
		return $data;
	}
	//查询列表操作
	function getagencyList($where,$limitText){
		$sqlText  = "select *,FROM_UNIXTIME(create_time,'%Y-%m-%d %H:%i:%s') create_time from gnw_agency ";
		$sqlText .= $where;
		$sqlText .= " order by create_time desc ";
		$sqlText .= $limitText;
		$data=$this->db->fetch_all($sqlText);
		return $data;
	}
	//查询单条数据操作
	function getagencyContent($agency_id){
		$sqlText = "select * from gnw_agency where agency_id=".$agency_id;
		$data=$this->db->fetch_first($sqlText);
		return $data;
	}
}


?>